<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<SCRIPT language=javascript src="<%=Config.getWebPath()%>/js/jquery.js"></SCRIPT>
<script language=javascript>

<%
String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");
if(msg != null){
%>
    alert("<%=msg%>");
<%
}
%>

var list_code = "listReportYKProductMonth";

function processInfo(){
	SetValue("title","3");
	frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServletForInfo") %>";
    frm.submit();
}

function process(val)
{
    SetValue("title","3");
    SetValue("warehouseCode",GetValue("i_WarehouseCode"));
    //SetValue("begindate",GetValue("i_Year"));
    //SetValue("enddate",GetValue("i_Month"));
    //SetValue("querytype","1");


    
    if(val == '1'){
        SetValue("begindate",GetValue("i_Year"));
        SetValue("enddate",GetValue("i_Month"));
        SetValue("querytype","1");
    }else{
        if(GetValue("i_StartLastUpdate") == ""){
            alert("起始日期不可为空!");
            return false;
        }
        SetValue("begindate",GetValue("i_StartLastUpdate"));
        SetValue("enddate",GetValue("i_EndLastUpdate"));
        SetValue("querytype","2");
    }




    frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServletHis") %>";
    frm.submit();
}

function isReportProcessing(val){

	$.ajax({
		type:"GET",
		url:"<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServletHis") %>",
		data:"action=isReportProcessing&val="+val,
		dataType:"json",
		success:successHandler,
		error:errorHandler
	});
}

function successHandler(response){
	if(response.result == false){
		process(response.val);		
	}
	
	alert("报表正在生成中,不要离开本页面,请耐心等待!");
	
}

function errorHandler(){
	alert("服务器处理异常，请稍后再试");
}
</script>


<%=uiBody%>>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="warehouseCode" value="">
<input type='hidden' name='begindate' value="">
<input type='hidden' name='enddate' value="">
<input type='hidden' name='querytype' value="">
<input type='hidden' name='title' value="">

<!--查询条件保留区域-->


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

<table id=listTable cellpadding='1' cellspacing='1' width='100%' class='data_line'><thead class='data_th'>

<tr align='center' height='24'>

    <td colspan = "2">压库产品进、销、存资金汇总月报</td></tr>

    
<tbody class='data_tb'>
    <tr height="24"  bgcolor="#EBEEF3">
        <td colspan = "2">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓库选择：
        <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode","",false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
        &nbsp;&nbsp;结算模式：压库
        </td>

    </tr>

    <tr height="24"  bgcolor="#FFFFFF">

        <td >&nbsp;月报：选择结算月份：<%=SelectManager.viewYearSelectHis(con,"i_Year","2008",false,"","-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month","01",false,"","-请选择-","","")%></td>

        <td >
            <input type="button" name="button1" class='buttons' value="生成报表" onclick='isReportProcessing(1)'><span id = "span1"></span>
        </td>
    </tr>    
    <tr height="24"  bgcolor="#EBEEF3">
        <td >&nbsp;&nbsp;&nbsp;选择时间段：<%=framework.custom.UIManager.generateDateInputHis("i_StartLastUpdate", "")%> 至 <%=framework.custom.UIManager.generateDateInputHis("i_EndLastUpdate", "")%></td>
        <td >
            <input type="button" i name="button2" class='buttons' value="生成报表" onclick='isReportProcessing(2)'><span id = "span2"></span>
        </td>
    </tr>

</tbody>
</table>


<%=uiSearchEnd%>

</form>
<div align="center">
	<table cellpadding='1' cellspacing='1'  class='data_tb'>
		<tr bgcolor="#EBEEF3">
			<td>提示：由于报表做过优化，会被IE拦截，请根据以下步骤进行操作</td>
		</tr>
		<tr>
			<td>
				第一种方式：<br>
				1.在浏览器上点选工具<br>
				2.点选Internet选项<br>
				3.选择标签页【安全】<br>
				4.点击按钮【自定义级别】<br>
				5.找到【下载】设置项，在【文件下载】和【文件下载自动提示】2个选项中，点选启用。<br>
				第二种方式：<br>
				1,2,3同上,选择受信任的站点<br>
				4.点选站点，去掉勾选项【对该区域中的所有站点要求服务器验证(https:)】<br>
				5.第一个输入框中输入【http://gw.apep.com.cn:10107/gw】,单击添加，最后确定<br>
			</td>
		</tr>
	</table>

</div>

<%@ include file="/framework/foot.jsp"%>
